<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

<!--  **步骤一**：引入ecahrts.js文件-->
  <script src="/js/echarts.js"></script>
  <script src="/jquery/jquery.min.js"></script>
</head>
<body>
  <script type="text/javascript">
    $.ajax({
      url: "/factOrderController/getOrder",
      type: "post",
      dataType: "json",
      async: true,
      success: function (list){
        var xDateArr = list.xAxis;
        var yDateArr = list.yAxis;
        // var yDateArr2 = list.yAxis2;
        // 基于准备好的dom，决定图标呈现的位置
        // 步骤三：初始化echarts实例对象
        var myChart = echarts.init(document.getElementById('main'));
        <!--步骤四：准备配置项-->
        option = {
          // 指定图表的配置项和数据
          title: {
            text: 'ECharts 入门示例'
          },
          tooltip: {},
          legend: {
            data: ['2021销量']
          },
          xAxis: {
            data: xDateArr
          },
          yAxis: {
            type: "value"
          },
          series: [
            {
              name: '2021销量',
              type: 'pie',
              data: yDateArr
            }
          ],
        };

        <!--步骤五：将配置项设置给我们的echarts实例对象-->
        myChart.setOption(option);
      },
      error:function (list){
        alert("网络异常")
      }
    })
  </script>
  <!--  **步骤二**：准备一个呈现图表的盒子-->
  <div id="main" style="width: 1000px;height:700px;"></div>

</body>
</html>